<?php
require_once("config.php");
require_once("functions.php");

if (!$allow_url_fopen) {
	echo '<span class="error"><b>Note</b>: Please enable \'<em>allow_url_fopen</em>\' option in PHP configuration file</span><br/>';
}

require_once("MSN.php");

$g = new MSN();

$domain = $_REQUEST['domain'];
list($with_www, $without_domain) = get_domain($domain);

$pages1 = $g->get_response($without_domain);
$link1 = $g->get_url(number_format($pages1),$without_domain);

$pages2 = $g->get_response($with_www);
$link2 = $g->get_url(number_format($pages2),$with_www);

$g->hostname = $GLOBALS['msn_index_hostname'];
$g->livesite = $GLOBALS['msn_index_live'];
$g->baseurl = $g->hostname;

$pages3 = $g->get_response($without_domain);
$link3 = $g->get_url(number_format($pages3),$without_domain);

$pages4 = $g->get_response($with_www);
$link4 = $g->get_url(number_format($pages4),$with_www);

?>
<table width="500" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="70%" align="left" class="dataLabel">Backlinks</td>
    <td width="30%" align="left" class="dataField"><?php echo $link1; ?></td>
  </tr>
  <tr>
    <td colspan="2" align="left" height="10"><img src="images/spacer.gif" width="1" height="1" alt=""></td>
  </tr>
  <tr>
    <td align="left" class="dataLabel">Backlinks (with www)</td>
    <td align="left" class="dataField"><?php echo $link2; ?></td>
  </tr>
  <tr>
    <td colspan="2" align="left" height="10"><img src="images/spacer.gif" width="1" height="1" alt=""></td>
  </tr>
  <tr>
    <td align="left" class="dataLabel">Pages Indexed<br><span class="smalltext">(includes pages of EVERY subdomain, eg. *.<?php echo $without_domain; ?>)</span></td>
    <td align="left" class="dataField"><?php echo $link3; ?></td>
  </tr>
  <tr>
    <td colspan="2" align="left" height="10"><img src="images/spacer.gif" width="1" height="1" alt=""></td>
  </tr>
  <tr>
    <td align="left" class="dataLabel">Pages Indexed<br><span class="smalltext">(includes pages of ONLY <?php echo $with_www; ?>)</span></td>
    <td align="left" class="dataField"><?php echo $link4; ?></td>
  </tr>
</table>